<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div class="fed-head-info fed-back-whits fed-min-width fed-box-shadow" th:fragment="nav">
    <div class="fed-part-case">
        <div class="fed-navs-left">
            <a class="fed-navs-logo" href="/"><img width="120" height="50" alt="无名影院" th:src="@{/static/img/logo.png}"></a>
            <a class="fed-navs-title fed-font-xvi fed-hide-xs fed-hide-sm fed-show-md-block" th:href="@{/}">首页</a>
            <!--分类-->
        </div>
        <div class="fed-navs-right">
            <a class="fed-navs-record fed-text-black fed-event fed-hide-xs fed-show-sm-block" href="javascript:;">看过<span class="fed-part-move fed-edge-info fed-edge-bottom"></span></a>
            <a class="fed-text-black fed-hide-xs fed-show-sm-block" th:href="@{/login}" th:if="${session.user}==null">登录</a>
            <a class="fed-navs-user fed-text-black fed-event fed-hide-xs fed-show-sm-block" href="javascript:;" th:unless="${session.user}==null">我的<span class="fed-part-move fed-edge-info fed-edge-bottom"></span></a>
            <a class="fed-navs-record fed-text-black fed-event fed-hide-sm fed-icon-font fed-icon-lishi" href="javascript:;"></a>
            <a class="fed-text-black fed-event" href="javascript:;" target="_blank">APP下载</a>
        </div>
        <div class="fed-pops-navbar fed-box-shadow fed-min-width fed-hidden fed-conceal fed-anim" style="display: none;">
            <div class="fed-pops-channel fed-back-whits fed-part-rows fed-line-top fed-hidden">选择频道</div>
            <a class="fed-pops-btn fed-back-whits fed-text-black fed-text-center fed-event fed-hide-sm fed-icon-font fed-icon-fenlei" href="javascript:;"></a>
            <ul class="fed-pops-list fed-font-size fed-back-whits fed-part-rows">
                <li class="fed-col-sm2 fed-hide-md"><a class="fed-part-eone" th:href="@{/}">首页</a></li>
            </ul>
        </div>
        <!--<div class="fed-pops-record fed-box-shadow fed-hidden fed-conceal fed-anim fed-anim-upbit" style="display: none;">
            <div class="fed-pops-title fed-back-whits fed-line-bottom fed-part-rows"><span class="fed-col-xs9">观看记录</span>
                <a class="fed-clear fed-event fed-text-right fed-col-xs3" href="javascript:;">清空</a>
            </div>
            <ul class="fed-pops-list fed-back-whits">
                <li class="fed-part-rows fed-line-bottom">
                    <a class="fed-part-rows" href="https://www.weishi432.com/index.php/vod/play/id/13130/sid/1/nid/1.html">
                        <span class="fed-part-eone fed-col-xs9">
                            xxxx
                            <span class="fed-text-muted">[第xx集]</span>
                        </span>
                        <span class="fed-part-eone fed-text-muted fed-text-right fed-col-xs3">xx平台</span>
                    </a>
                </li>
            </ul>
        </div>
        <div class="fed-pops-code fed-back-whits fed-box-shadow fed-hidden fed-conceal fed-anim fed-anim-upbit" style="display: none;">
            <div class="fed-pops-cont">
                <p>下载地址：<a href="https://www.lanzous.com/b322033/" target="_self">https://www.lanzous.com/b322033/</a></p>			</div>
        </div>-->
        <div class="fed-pops-user fed-box-shadow fed-back-whits fed-hidden fed-conceal fed-anim fed-anim-upbit" style="margin-top:5rem">
            <ul class="fed-pops-list fed-font-size fed-back-whits">
                <li><a th:href="@{/user/home}" th:text="${session.user}==null?'请登录':${session.user.username}"></a></li>
                <li><a th:href="@{/user/admin}" th:if="${session.user!=null&&session.user.permission==1}">管理</a></li>
                <li><a th:href="@{/user/edit}">修改资料</a></li>
                <!--<li><a th:href="@{/user/favs}">我的收藏</a></li>
                <li><a th:href="@{/user/history}">播放记录</a></li>-->
                <li><a th:href="@{/user/logout}">退出登录</a></li>
            </ul>
        </div>
    </div>
    <script th:inline="javascript">
        var context=/*[[@{/}]]*/'';
        var ctx=context=="\/"?"":context;
        $(function () {
            //获取分类
            $.ajax({
                "url":ctx+"/catlog/all",
                "type":"get",
                "async":false,
                "success":function (data) {
                    if(data.code==0){
                        $.each(data.data,function(index,value){
                            var item1="<a class='fed-navs-title fed-font-xvi fed-hide-xs fed-hide-sm fed-show-md-block'" +
                                "href='"+ctx+"/film/catlog/"+value.catlogId+"'>"+value.catlogName+"</a>";
                            $(".fed-navs-left").append(item1);
                            var item2="<li class='fed-col-sm2 fed-hide-md'><a class='fed-part-eone'" +
                                "href='"+ctx+"/film/catlog/"+value.catlogId+"'>"+value.catlogName+"</a></li>";
                            $(".fed-pops-navbar ul").append(item2);
                        });
                    }
                }
            });

            //弹出用户菜单
            $(".fed-navs-user").click(function () {
                var triangle=$(this).children(".fed-part-move");
                if($(triangle).is(".fed-edge-bottom")){
                    $(".fed-pops-user").css("display","block");
                    triangle.removeClass("fed-edge-bottom");
                    triangle.addClass("fed-edge-top");
                }else{
                    $(".fed-pops-user").css("display","none");
                    triangle.removeClass("fed-edge-top");
                    triangle.addClass("fed-edge-bottom");
                }
            });
        });
    </script>
</div>
</html>
